<?php

/* Text security cleaning
*/
function clear($text) {
    // Slashes deleting
    if(get_magic_quotes_gpc()) {
        $text = stripslashes($text);
    }
    $text = trim($text); // Deleting whitespaces
    $text = mysql_real_escape_string($text); // Anti-sql injection
    $text = htmlspecialchars($text); // Html code deactivation
    return $text;
} //end clear($text)

/*Password encryption
*/
function codepass($password) {
	return hash('ripemd160', clear($password)); // adding hash to password
} //end codepass($password)

?>